<nz-content>
  <div class="divposition">
    <div class="systitle">精益成熟度测评系统</div>
    <div class="syssubtitle">Lean CT</div>
    <div class="login-content">
      <div id="tab">
        <div (click)="show(1)">
          <div class="{{page1?'atv':'noatv'}}"><i nz-icon [nzType]="'user'"></i>账号/密码</div>
        </div>

        <div (click)="show(2)" onclick="wxLoad()">
          <div class="{{page2?'atv':'noatv'}}"><i nz-icon [nzType]="'wechat'"></i>微信登录</div>
        </div>
      </div>
      <div [hidden]="!page1" id="divpage1">
        <form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
          <nz-form-item>
            <nz-form-control [nzErrorTip]="errUserNameMsg">
              <nz-input-group nzPrefixIcon="user">
                <input type="text" nz-input formControlName="userName" placeholder="用户名" maxlength="20"
                       class="inputstyle" autocomplete="username"/>
              </nz-input-group>
              <ng-template #errUserNameMsg>
                <ng-container *ngIf="userName.errors.required">
                  请输入用户名!
                </ng-container>
                <ng-container *ngIf="userName.errors.minlength">
                  用户名的长度不能小于6！
                </ng-container>
                <ng-container *ngIf="userName.errors.maxlength">
                  用户名的长度不能大于20！
                </ng-container>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
          <nz-form-item>
            <nz-form-control [nzErrorTip]="errPwdMsg">
              <nz-input-group nzPrefixIcon="lock" [nzSuffix]="suffixTemplate">
                <input nz-input [type]="passwordVisible ? 'text' : 'password'" formControlName="password"
                       placeholder="密码"
                       maxlength="10" class="inputstyle"
                       autocomplete="current-password"/>
              </nz-input-group>
              <ng-template #suffixTemplate>
                <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'"
                   (click)="passwordVisible = !passwordVisible"></i>
              </ng-template>
              <ng-template #errPwdMsg>
                <ng-container *ngIf="password.errors.required">
                  请输入密码!
                </ng-container>
                <ng-container *ngIf="password.errors.minlength">
                  密码的长度不能小于6！
                </ng-container>
                <ng-container *ngIf="password.errors.maxlength">
                  密码的长度不能大于10！
                </ng-container>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
          <nz-form-item>
            <nz-form-control>
              <label nz-checkbox formControlName="remember" style="display: none;">
                <span>记住我</span>
              </label>
              <a class="login-form-forgot" style="display: none;">忘记密码</a>
              <button nz-button class="login-form-button" [nzType]="'primary'">登录</button>

            </nz-form-control>
          </nz-form-item>
        </form>
      </div>
      <div [hidden]="!page2" id="divpage2">
      </div>
      <div [class]="page1 ? 'regcontent' : 'wxregcontent'">
        <button nz-button nzType="link" (click)="onGotoRegister()" class="buttonregister">或注册！</button>
      </div>
    </div>
  </div>
</nz-content>

